﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

/* El TagName del Register del .ascx te define que objeto usas despues
 * del this. en el Page_Load. Ahi tenes que poner el evento que definiste en
 * el ascx.cs del subcontrol que se usa como vista 
*/

namespace VirtualTournaments.Frontend.MenuControls.GamblingManagerMenu
{
    public partial class GamblingManagerMenu : System.Web.UI.UserControl
    {
        public EventHandler GamblingManagerMenuGoBackButtonClicked;
        
        public const int GamblingMainMenuIndex = 0;
        public const int TournamentBetMenuIndex = 1;
        public const int MatchBetMenuIndex = 2;
       
        protected void Page_Load(object sender, EventArgs e)
        {
            this.MainMenuControl.GamblingMainMenuGoBackButtonClicked += new EventHandler(MainMenuControl_GoBackButtonClicked);
        }

        protected void GamblingManagerMenu_GoToTBetPage(object sender, EventArgs e)
        {
            this.GamblingMenuViews.ActiveViewIndex = 1;
        }

        private void GamblingManagerMenu_TournamentBetButtonClicked(object sender, EventArgs e)
        {
            //TODO: CONSTANTS
            GamblingMenuViews.ActiveViewIndex = TournamentBetMenuIndex;
        }

        private void GamblingManagerMenu_MatchBetButtonClicked(object sender, EventArgs e)
        {
            //TODO: CONSTANTS
            GamblingMenuViews.ActiveViewIndex = MatchBetMenuIndex;
        }

        private void MainMenuControl_GoBackButtonClicked(object sender, EventArgs e) 
        {
            GamblingManagerMenuGoBackButtonClicked(this, new VirtualTournamentsFrontendEvent { SenderMenu = "GamblingManagerMenu" });
        }

    }
}